{extend name="public:layout" /}
{block name="title"}表单列表{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li>
                    <i class="fa fa-hand-o-right"></i>
                    <a href="{:url('index')}">自定义表单</a>
                </li>
                <li class="active">表单列表</li>
            </ol>
        </div>
        <div class="ibox-content">
            <div class="toolbar">
                <a class="btn btn-primary" href="{:url('add')}">
                    <i class="fa fa-plus"></i>&nbsp;添加表单
                </a>
            </div>
                <table class="table table-bordered" id="grid">
                    <tr>
                        <th>#</th>
                        <th>表单名称</th>
                        <th>表名</th>
                        <th>系统</th>
                        <th>状态</th>
                        <th>排序</th>
                        <th width="280">操作</th>
                    </tr>
                    {volist name="list" id="vo"}
                    <tr>
                        <td>{$vo.form_id}</td>
                        <td>{$vo.form_name}</td>
                        <td>form_{$vo.table_name}</td>
                        <td>{$vo.is_system_text}</td>
                        <td>{$vo.form_status_text}</td>
                        <td>{$vo.form_sort}</td>
                        <td>
                            <a href="{:url('edit',['form_id'=>$vo['form_id']])}">编辑</a>
                            <a href="{:url('setStatus',['form_id'=>$vo['form_id']])}">
                                {eq name="vo.form_status" value="1"}锁定{else/}开启{/eq}
                            </a>
                            <a href="{:url('FormField/index',['form_id'=>$vo['form_id']])}">字段管理</a>
                            <a data-url="{:url('createHtml',['form_id'=>$vo['form_id']])}" onclick="getHtml(this)">模板预览</a>
                            <a href="{:url('feedList',['form_id'=>$vo['form_id']])}">查看反馈</a>
                            {eq name="vo.is_system" value="0"}
                            <a href="javascript:;" onclick="doAction(this);"
                               data-msg="此操作不可逆！<br/>确认删除吗？" data-url="{:url('del')}"
                               data-params="form_id={$vo.form_id}">删除</a>
                            {/eq}
                        </td>
                    </tr>
                    {/volist}
                </table>
                <div class="page-bar">{$list->render()}</div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    function getHtml(obj){
        var url = $(obj).data('url');
        openDialog('表单参考代码', url, '800px', '420px');
    }
</script>
{/block}